package com.yungui.rabbitmq.mq.rabbitmq;

import com.yungui.rabbitmq.entity.LoggerInfoUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class RabbitMqService {
    Logger logger = LoggerFactory.getLogger(getClass());
    @RabbitListener(queues = "wangyun_test_queue")
    public void receiveMsg(byte[] message){
        String receiveMessage = new String(message);
        logger.info("{}", LoggerInfoUtil.getInstance().buildLoggerInfo("title","获取课表消息").buildLoggerInfo("content",receiveMessage));
    }
}
